package cc.itstone.subject.domain.service.impl;

import cc.itstone.subject.domain.entity.SubjectCategoryBO;
import cc.itstone.subject.domain.service.SubjectCategoryDomainService;
import cc.itstone.subject.infra.basic.entity.SubjectCategory;
import cc.itstone.subject.infra.basic.service.SubjectCategoryService;
import cc.itstone.subject.infra.basic.utlis.CopyUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

/**
 * @author stone
 */
@Service
@Slf4j
public class SubjectCategoryDomainServiceImpl implements SubjectCategoryDomainService {
    @Resource
    private SubjectCategoryService subjectCategoryService;

    @Override
    public void add(SubjectCategoryBO subjectCategoryBO) {
        SubjectCategory subjectCategory = CopyUtil.copy(subjectCategoryBO, SubjectCategory.class);
        subjectCategoryService.insert(subjectCategory);
    }

    @Override
    public List<SubjectCategory> queryCategory(SubjectCategory subjectCategory) {
        return subjectCategoryService.queryCategory(subjectCategory);
    }
}
